import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const base = {
    state: {
        token:'',
    },
    mutations: {
        setToken(state, payload){
            state.token = payload
        },
    },
    actions: {
        // 提交改变后的状态
    },
    getters: {
        getToken: state => {
            return state.token;
        }
    }
}

const options = {
    modules: {
        base: base
    },

}

const store = new Vuex.Store(options)

export default store
